/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Victor
 */
@Entity
@Table(name = "clientes_contactos")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ClientesContactos.findAll", query = "SELECT c FROM ClientesContactos c"),
    @NamedQuery(name = "ClientesContactos.findById", query = "SELECT c FROM ClientesContactos c WHERE c.id = :id"),
    @NamedQuery(name = "ClientesContactos.findByidCliente", query = "SELECT c FROM ClientesContactos c WHERE c.idClientes.id = :idCliente"),
    @NamedQuery(name = "ClientesContactos.findByNombre", query = "SELECT c FROM ClientesContactos c WHERE c.nombre = :nombre"),
    @NamedQuery(name = "ClientesContactos.findByCargo", query = "SELECT c FROM ClientesContactos c WHERE c.cargo = :cargo"),
    @NamedQuery(name = "ClientesContactos.findByTelefonos", query = "SELECT c FROM ClientesContactos c WHERE c.telefonos = :telefonos"),
    @NamedQuery(name = "ClientesContactos.findByEmail", query = "SELECT c FROM ClientesContactos c WHERE c.email = :email")})
public class ClientesContactos implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "nombre")
    private String nombre;
    @Column(name = "cargo")
    private String cargo;
    @Column(name = "telefonos")
    private String telefonos;
    @Column(name = "email")
    private String email;
    @JoinColumn(name = "id_clientes", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private Clientes idClientes;

    public ClientesContactos() {
    }

    public ClientesContactos(Integer id) {
        this.id = id;
    }

    public ClientesContactos(Integer id, String nombre) {
        this.id = id;
        this.nombre = nombre;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public String getCargo() {
        return cargo;
    }

    public void setCargo(String cargo) {
        this.cargo = cargo;
    }

    public String getTelefonos() {
        return telefonos;
    }

    public void setTelefonos(String telefonos) {
        this.telefonos = telefonos;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public Clientes getIdClientes() {
        return idClientes;
    }

    public void setIdClientes(Clientes idClientes) {
        this.idClientes = idClientes;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ClientesContactos)) {
            return false;
        }
        ClientesContactos other = (ClientesContactos) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.ClientesContactos[ id=" + id + " ]";
    }
    
}
